import math

target = 1000000
count = 0
for n in range(100, 1, -1):
    if math.comb(n, (n + 1) // 2) < target:
        break
    for r in range(n // 2, 1, -1):
        if math.comb(n, r) < target:
            count += n - 2 * r - 1
            print(n, count)
            break
print(count)
